package com.ha7419x.aop;

import com.ha7419x.anno.AppAnno2;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Objects;

@Aspect
@Component
@Order(2)
public class AppAop2 {

    @Around("@annotation(appAnno2)")
    public void doCheck(ProceedingJoinPoint joinPoint, AppAnno2 appAnno2) throws Throwable {
        if (Objects.equals(appAnno2.value(), "2")) {
            System.out.println("&&&&&&代理2&&&&&&&&");
            joinPoint.proceed();
        }
    }
}
